package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 回款计划中回款状态
 * 
 * @author liaojunjun
 *
 */
@AllArgsConstructor
@Getter
public enum InvestorPlanReceivedStatusEnum {
	NON_RECEIVE((byte) 1, "未收款"),

	NORMAL_RECEIVE((byte) 2, "正常收款"),

	OVERDUE_RECEIVE((byte) 3, "逾期收款"),

	OVER_DEBT_RECEIVE((byte)4, "已提前结清"),

	TRANSFERRED((byte)5, "已转让");

	/**
	 * 回款状态
	 */
	private Byte code;

	private String value;

	public static InvestorPlanReceivedStatusEnum enumOf(int code) {
		for (InvestorPlanReceivedStatusEnum receivedStatus : values()) {
			if (receivedStatus.code == code) {
				return receivedStatus;
			}
		}
		throw new NoSuchEnumValueException("InvestorPlanReceivedStatusEnum:" + code);
	}
}
